<html>
<head>
<title>MyFreeEducation</title>
<link href="../Themes/Standard/Standard.css" rel="stylesheet" type="text/css" />
<script>
function _JsExp(){
	this.over=function(el){			
		el.className="over";
	};
	this.out=function(el){
		el.className="out";
	};	
	
	this.overCat=function(el){			
		el.className="over";
	};
	this.outCat=function(el){
		el.className="out";
	};	
	
	this.checkData=function(objf)
	{
		submit=1;
		if (trim_str(objf.tbUsername.value)=="")
		{
			submit=0;
			alert("You must enter username!");
			return;
		}
		
		if (trim_str(objf.tbPassword.value)=="")
		{
			submit=0;
			alert("You must enter Password!");
			return;
		}
		
		if (trim_str(objf.tbPassword.value)!=trim_str(objf.tbConfirmPassword.value))
		{
			submit=0;
			alert("Passwords do not match!");
			return;
		}
		
		if (submit==1)
		{
			objf.submit();
		}
	};
	
	this.checkUpdate=function(objf)
	{
		submit=1;
		if (trim_str(objf.tbPassword.value)!=trim_str(objf.tbConfirmPassword.value))
		{
			submit=0;
			alert("Passwords do not match!");
			return;
		}
		if (submit==1)
		{
			objf.submit();
		}
	};
	function trim_str(temp1){
		while(temp1.indexOf("'")!=-1)temp1=temp1.replace("'","")
		while(temp1.charAt(0)==" ")temp1=temp1.replace(temp1.charAt(0),"")
		i=temp1.length-1;while(i>0 && temp1.charAt(i)==" ")i--;temp1=temp1.substring(0,i+1)
		return temp1
	};
	
	this.uploadImg=function(id)
	{		
		 myRef = window.open('../AddImage.aspx?prid=' + id ,'','left=200,top=200,width=500,height=260,toolbar=0,resizable=0,scrollbars=0');
	}
	

}
var JsExp=new _JsExp();

	
</script>
</head>
<body>

#set ($cp = $RenderCtx.CurrentPage)
#set ($pl = $RenderCtx.PageList)
#set ($cc = $RenderCtx.CurrentContent)
#set ($ex = "_0_0/default.aspx")
#set ($cCat = $RenderCtx.CurrentCategory)
#set ($adList = $RenderCtx.AdContentList)
#set ($count = 0)
#set ($line = 0)

#set ($count = 0)
#macro( bindPage $PageList )
	#if($itemList)
		#set ($tempList = $itemList)
	#end
	#set ($line = ${line}+1)

	#if ($line > 2)
	  #set ($line = 1)
	#end

	#if ($PageList.Count>0)
		<ul class="toolbar${line}" >
		#foreach($p in $PageList)
			#if ($count==0)
				#set($ID=0)
			#else
				#set($ID=$p.ID)
			#end
			#set ($count = ${count}+1)
			
			#if($p.Hidden == true)
				#if($p.ID==$cp.ID)
					<li><a href="../${ID}${ex}" class="over" > $p.Name  </a></li>
				#else
					<li><a href="../${ID}${ex}" class="out" onmouseover="JsExp.over(this)" onmouseout="JsExp.out(this)"> $p.Name  </a></li>
				#end
			#end
				
		    #if($p.IsActive)
				#set ($itemList = $p.SubPageList)
			#end
			
		#end
	    </ul>
	#end
		#if($itemList)
			#if($itemList!=$tempList)
				#bindPage($itemList)
			#end	
		#end
 
#end
 
#set($Count=0)
 #macro( bindPath $PathList )

	#if($PathList)
		#set ($tempPathList = $PathList)
	#end
	
	#if ($PathList.Count>0)
		#foreach($pt in $PathList)
		    #if($pt.IsActive)
				#if($Count==0)
					#set($pathID=0)
				#else
					#set($pathID=$pt.ID)
				#end
				#set($path=$pt)
				#set ($PathList = $pt.SubPageList)
				
			#end
			#set($Count=1)
		#end
		
		#if($path)
			#if($PageID==$path.ID)
				#if($cCat)
					<a href="../${pathID}_0_0/default.aspx"> $path.Name</a>
				#else
				    $path.Name
				#end
				#set ($PathList = $tempPathList)
				#set ($char=1)
			#else	
				<a href="../${pathID}_0_0/default.aspx"> $path.Name</a>
			#end
		#end
	#end
	
	#if($PathList)
			#if($PathList!=$tempPathList)
				»
				#bindPath($PathList)
			#end	
	#end
		
 #end
 
 
 #if($cCat)
   #set($catId="0")
 #else
   #set($catId=$cCat.ID)
#end


<div id="cms_menu">	
	
	#bindPage($pl) 
	
</div>
<div id="cms_banner">
	<div class="logo">	
	</div>	
	
	<div  class="linebanner">
	</div>

		
	<div class="search">
		<form name="f" method="Post" action="../Search.aspx">
		<input type="textbox" name="tbSearch"><input type="submit" value="search" class="button" >
		<a href="../RssFeed.aspx" class="rss">
		&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;
		</a>
		</form>
		
	</div>
	
	<div class="ad">
	#if ($adList.Count>0)
		#foreach($ad in $adList)
			#if($ad.Type=="Banner")
			<a href="#" onclick="JsExp.openUrl('${ad.Url}')" ><img src="../ImageView.aspx?ad=${ad.ID}${ad.Extention}" border="0" /></a>
			#end
		#end
	#end
	
	</div>
	<div class="infostatitic">
		Site Access Number: $!{SiteAccessNumber}
		</div>
	
	
</div>

#set ($default= "0")
<div id="cms_contentmain"> 
	##-------------------login----------------------
	#if(${Login})
		#set ($default= "1")
		#set ($default= "1")
		<form name="fLogin" class="text" method="Post" action="../registerUser.aspx?login=1" >
		<div id="cms_register">	
			<div class="header">
				 <br><b> &nbsp; Login to Gallery IGlobalList</b><br>
				&nbsp; Not yet a member? <a href="../../${PageID}_0_0/default.aspx?signup=1">Sign up a account.</a>
			</div>
			<div class="body">
					#if(${Login}==2)
						<font color="red"> <br> &nbsp;Invalid username or password!</font>
					#end
					<br>
					Username<br>
					<input type="text" name="tbUsername"><br><br>
					Password<br>
					<input type="password" name="tbPassword"><br><br>
				<input type="submit" value="Login" name="btnLogin">
				
			</div>
		</div>
		</form>
	#end
	
	##-------------------Signup----------------------
	
	#if(${Signup}>0)
		#set ($default= "1")
			<div id="cms_register"> 
				<div class="header">
				 <br><b> &nbsp; Account Registration</b><br>
				&nbsp; Already a member? <a href="../../${PageID}_0_0/default.aspx?login=1">Login.</a>
				</div>
				<div class="body" style="height:250px">
					<form name="fregister" class="text" method="Post" action="../registerUser.aspx?new=1" >
					#if(${Signup}==2)
						<font color="red"> Username is exist!<br></font>
					#end
					Username<br>
					<input type="text" name="tbUsername"><br><br>
					
					Email address<br>
					<input type="text" name="tbEmail"><br><br>
					
					Password<br>
					<input type="password" name="tbPassword"><br><br>
					
					Confirm password<br>
					<input type="password" name="tbConfirmPassword"><br><br>
					
					 <input type="button" value="register" name="btnregister" onclick="JsExp.checkData(this.form)">
					</form>
				</div>
			</div>
	#end
	
	
	##-------------------my account----------------------
	
	#if(${Account}>0)
		#set ($default= "1")
			<div id="cms_register"> 
				<div class="header">
				 <br><b> &nbsp; Update Account for $User.UserName </b><br>

				 #if(${Account}== "2" )
					<font color="white">&nbsp; Your account has been updated.</font>
				 #end
				</div>
				
				<div class="body" style="height:250px">
					<form name="fAcount" class="text" method="Post" action="../registerUser.aspx?edit=1" >
					Please enter any new information about yourself below and press the "Update Details" button at the bottom of this page.<br>
					<table>
						<tr><td>Email address</td><td Style="width:20px;"></td><td><input type="text" name="tbEmail" value="${User.Email}"></td></tr>
						<tr><td>New Password</td><td Style="width:20px;"></td><td><input type="password" name="tbPassword"></td></tr>
						<tr><td>New password confirm</td><td Style="width:20px;"></td><td><input type="password" name="tbConfirmPassword"></td></tr>
						<tr><td>First name</td><td Style="width:20px;"></td><td><input type="text" name="tbFName" value="${User.Firstname}" ></td></tr>
						<tr><td>Last name</td><td Style="width:20px;"></td><td><input type="text" name="tbLName" value="${User.Lastname}"></td></tr>
						<tr><td>Middle name</td><td Style="width:20px;"></td><td><input type="text" name="tbMName" value="${User.Middle}"></td></tr>
						<tr><td>Address</td><td Style="width:20px;"></td><td><input type="text" name="tbAddress" value="${User.Address}" size="50"></td></tr>
						<tr><td>Phone </td><td Style="width:20px;"></td><td><input type="text" name="tbPhone" value="${User.Phone}" ></td></tr>
						<tr><td>Zip/Postal Code </td><td Style="width:20px;"></td><td><input type="text" name="tbZip" value="${User.Zipcode}" size="10"></td></tr>
						<tr><td>City</td><td Style="width:20px;"></td><td><input type="text" name="tbCity" value="${User.City}" ></td></tr>
						<tr><td>Country</td><td Style="width:20px;"></td><td><select style="width:300px;" name="ddlCountry">
							<option value="0">Select country</option>
							#foreach($country in $Countries)
								#if($User.Country==$country.Value)
									<option value="${country.Value}" selected="true" >${country.Text}</option>
								#else
									<option value="${country.Value}" >${country.Text}</option>
								#end
							#end
							
						</select></td></tr>
						<tr><td colspan="3" align="center"><input type="button" value="Update detail " name="btnUpdate" onclick="JsExp.checkUpdate(this.form)"></td></tr>
					</table>
					 
					</form>
				</div>
			</div>
	#end
	
	
	##-------------------Success----------------------
	
	#if(${Success})
		#set ($default= "1")
			<div id="cms_register"> 
				<div class="header">
					 <br><b> &nbsp;  Your register success! <a href="../0_0_0/default.aspx"> Continue </a><br>
					 &nbsp;   <a href="../../${PageLoginID}_0_0/default.aspx?account=1"> Profile for $User.UserName </a> </b><br>
				</div>
				<div class="body" style="height:100px;"><br>
					<form class="text">
						Username: $User.UserName<br>
						
						Email address: $User.Email<br>
					</form>
				</div>
			</div>
		
	#end
	
</div>

<div id="cms_footer">
	<div class="text">Copyright @ IGlobalist </div>
</div>

</html>
